Window definition functions are stored as resources of type 'WDEF' . The 'WDEF' resource is simply the executable code for the window definition function.
All resources of type 'WDEF' should be nonpurgeable. This ensures that the resource is always available, even if your application is not frontmost.
The two standard window definition functions supplied by the Window Manager use resource IDs 0 and 1.